import jinja2
import os
from google.appengine.ext import ndb


jinja_environment = jinja2.Environment(
    loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))

    
class Era(ndb.Model):
    name = ndb.StringProperty()
    start = ndb.IntegerProperty()
    desc = ndb.TextProperty()


class Operation ():
    def getStartYear(self, era_name):
        eras = Era.query(Era.name == era_name)
        for era_entity in eras:
            return era_entity.start

